package Test;

import java.util.Scanner;

/*
倒置字符串
* */
public class Test3 {
    public static void reserve(char [] arr,int start, int end){
        while(start < end){
            char tem = arr[start];
            arr[start] = arr[end];
            arr[end] = tem;
            start++;
            end--;
        }

    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        char [] ch = str.toCharArray();
        reserve(ch,0,ch.length-1);
        int i = 0;
        while(i < ch.length){
            int j = i;
            while(j < ch.length && ch[j] != ' '){
                j++;
            }
            if(j < ch.length){
                reserve(ch,i,j-1);
                i = j+1;
            }else{
                reserve(ch,i,j-1);
                i = j;
            }
        }
        String str2 = new String(ch);
        System.out.println(str2);
    }
}
